-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(next-international): plurals with count 0 works with #zero
#217
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! After thinking more about this, I agree to land this change as it makes more sense - and it's not really a breaking change either.
I would like to include this as part of the 1.1.0 release: #205
function getPluralKey(count: number) { | ||
if (count === 0) return 'zero'; | ||
return pluralRules.select(count); | ||
} | ||
const pluralRules = new Intl.PluralRules(context.locale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this pluralRules
variable before the new getPluralKey
function? We try to keep things declared before they are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
#zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
* feat(next-international): redirect default with `rewriteDefault` (#204) * feat(next-international): Static Rendering with loading for Client Components (#202) * feat(next-international): preserve search params (#207) * refactor: update client provider * feat: cache locale loading * feat: avoid triggering suspense with useParams * feat(next-international): plurals with count 0 works with `#zero` (#217) * make sure zero, one, two works * add plural key for only "zero" * move pluralRules * update docs * chore: bump version --------- Co-authored-by: Carl-Gerhard Lindesvärd <lindesvard@gmail.com>
Closes #199